package com.example.demo.security.sysUser.service;


import com.example.demo.common.ResultBean;
import com.example.demo.security.sysUser.dao.UserDao;
import com.example.demo.security.sysUser.entity.UserBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class UserService {

    @Autowired
    private UserDao userDao;

    /**
     * 根据用户id查询其好友列表
     * @author 自嘲
     * @param id
     * @return
     */
    public List<UserBean> queryFriends(Integer id){
        return userDao.queryFriends(id);
    }

    public String queryUserNameById(Integer id){
        UserBean userBean=userDao.queryUserNameById(id);
        return userBean.getUserName();
    }

    public List<UserBean> queryFriendsById(Integer id,String name){
        return userDao.queryFriendsById(id,name);
    }

    public Integer addFriend(Integer userId,Integer id){
        return userDao.addFriend(userId,id);
    }

    public List<UserBean> queryAddMessageById(Integer id){
        return userDao.queryAddMessageById(id);
    }

    public Integer agreeMessage(Integer userId,Integer id){
        return userDao.agreeMessage(userId,id);
    }
    public Integer disagreeMessage(Integer userId,Integer id){
        return userDao.disagreeMessage(userId,id);
    }

    public List<UserBean> queryNotInGroup(Integer id,Integer groupId){
        return userDao.queryNotInGroup(id,groupId);
    }

    public Integer exitFriend(Integer id,Integer friendId){
        return userDao.exitFriend(id,friendId);
    }
}
